package com.fsy.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fsy.entities.Message;
import com.fsy.service.MessageService;
import com.fsy.mapper.MessageMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
* @author 凡凡
* @description 针对表【message】的数据库操作Service实现
* @createDate 2022-04-29 11:18:39
*/
@Service
public class MessageServiceImpl extends ServiceImpl<MessageMapper, Message>
    implements MessageService{

    @Resource
    private MessageMapper messageMapper;

    @Override
    public List<Message> selectAllByReceiverId(Message message) {
        message.setPage((message.getPage()-1)*message.getLimit());
        return messageMapper.selectAllByReceiverId(message);
    }

    @Override
    public int getCount(Message message) {
        return messageMapper.getCount(message);
    }
}




